<style>
	.mailto{width:495px;height:330px;overflow:auto;background:#EFEFEF;padding-top:20px;align:center;}
	.mailto table tr td{font-size:12px;}
	.mailto #submit{background:#005EAC;border:0;color:white;font-size:12px;padding:4px 15px;text-align: center;}
	.mailto #button{background:#CCC;border:0;color:#333;font-size:12px;padding:4px 15px;text-align: center;}
	.mailto .Receiver1,.mailto #Title,.mailto #Content{border:0;background:#f5f5f5;border-bottom:1px solid #666;}
</style>
<div class="mailto" style="float:left;">
	<iframe name="iframe1" src="" frameborder="0" style="display:none" ></iframe>
	<form action="{:U('Student/Mail/mailto')}" method="post" target="iframe1">
		<table>
			<tr>
				<td>收件人</td>
				<td>
					<input type="text" value="{$userdetail[0].TrueName}" class="Receiver1" disabled="disabled" style="width:150px;" />
					<input name="mailto" id="Receiver1" type="hidden" value="{$uid}" />
					<span id="Receiver1check" style="color:Red;">*</span>
				</td>
			</tr>
			<tr>
				<td> 标 题</td>
				<td>
					<input name="Title" type="text" id="Title" style="width:425px;" maxlength="20" />
					<span id="Titlecheck" style="color:Red;">*</span>
				</td>
			</tr>
			<tr>
				<td valign="top"> 正 文</td>
				<td>
					<textarea name="Content" rows="2"  cols="10" id="Content" style="resize:none;height:200px;width:425px;border:1px solid #666;"></textarea>
					<span id="Contentcheck" style="color:Red;">*</span>
				</td>
			</tr>
		</table>
		<div style="height:30px;line-height:30px;">
			<span id="Contentlimit" style="color:Red;margin-left:40px;height:30px;line-height:30px;"></span>
		</div>
		<input type="submit" id="submit" value="发 送" style="margin-left:70px;" />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="button" id="button" value="关 闭" class="closeload" />
	</form>
</div>
<script type="text/javascript">
	$("#Content").keydown(function(){
		var num=$(this).val().length;
		var limit=500-num;
		$("#Contentlimit").html("剩余字符数："+limit);
		$("#Content").val($("#Content").val().slice(0,50));
		if(limit<1){
			return false;
		}
	});
	$("#Content").blur(function(){
		$("#Content").val($("#Content").val().slice(0,50));
	})
	$("#submit").click(function(){
		$("#Content").val($("#Content").val().slice(0,50));
		var Receiver1=$("#Receiver1");
		var Title=$("#Title");
		var Content=$("#Content");
		if(Title.val()=="" || Title.val()=="标题不得为空"){
			Title.val()=="标题不得为空";
			return false;
		}
		if(Content.val()=="" || Content.val()=="内容不得为空"){
			Content.val()=="内容不得为空";
			return false;
		}
	});
	function uploadCallBack(res){
		if(res){
			alert("邮件发送成功！点击关闭");
			$(".load_body").html("");
			$(".ajaxloadhtml").hide();
		}else{
			alert("邮件发送失败");
		}
	}
</script>